package com.gable.exhibition.dao;

import com.gable.exhibition.model.Device;
import com.gable.exhibition.view.DeviceView;

import java.util.List;
import java.util.Map;

public interface DeviceDao {
    int deleteByPrimaryKey(Long deviceId);

    int insert(Device record);

    int insertSelective(Device record);

    Device selectByPrimaryKey(Long deviceId);

    int updateByPrimaryKeySelective(Device record);

    int updateByPrimaryKey(Device record);

    /**
     * 获取设备总数 用于分页
     * @param deviceView
     * @Create user jacky
     * @Create date 2018/2/23
     * @return
     */
    int queryDeviceCount(DeviceView deviceView);

    /**
     * 获取设备列表 用于分页
     * @param deviceView
     * @Create user jacky
     * @Create date 2018/2/23
     * @return
     */
    List<DeviceView> queryDeviceList(DeviceView deviceView);

    /**
     * 获取设备详情
     * @param deviceId
     * @Create user jacky
     * @Create date 2018/2/23
     * @return
     */
    DeviceView queryDeviceInfo(Long deviceId);

    /**
     * 校验sn是否存在
     * @param map
     * @Create user jacky
     * @Create date 2018/2/23
     * @return
     */
    int checkDeviceSn(Map map);

    /**
     * 根据关键字检索设备
     * @param map
     * @Create user jacky
     * @Create date 2018/2/25
     * @return
     */
    List<DeviceView> queryDeviceByKeyword(Map map);

    /**
     * 根据关键字检索在维修中的设备
     * @param map
     * @Create user jacky
     * @Create date 2018/2/25
     * @return
     */
    List<DeviceView> queryDeviceByRepairAndKeyword(Map map);

    /**
     * 根据关键字检索在合同中的设备
     * @param map
     * @Create user jacky
     * @Create date 2018/2/26
     * @return
     */
    List<DeviceView> queryDeviceByContractAndKeyword(Map map);
}